package com.mjf.scala.chapter07

/**
 * 多维数组
 */
object Scala03_TestMulArray {
  def main(args: Array[String]): Unit = {

    // 创建多维数组
    val arr: Array[Array[Int]] = Array.ofDim[Int](2, 3)

    arr(1)(0) = 20

    // 对二维数组进行遍历
    for (i <- 0 until arr.length; j <- 0 until arr(i).length) {
      println(arr(i)(j))
    }

    // 创建5维数组
    val newArr: Array[Array[Array[Array[Array[Int]]]]] = Array.ofDim[Int](2, 3, 4, 5, 6)

  }
}
